<!--
 * @Description: 
 * @Author: Zhangx
 * @Date: 2023-07-28 14:41:59
 * @LastEditors: Zhangx
 * @LastEditTime: 2023-07-31 10:55:08
-->
<template>
  <commonDialog
  :dialogVisible="dialogVisible"
  :dialogTitle="(isCheck ? '查看' :isEdit ? '修改' :'新增')"
  :confirmText="state.confirmText"
  :saveText="state.saveText"
  @cancel-click="handleCancel"
  @confirm-click="handleConfirm"
  @save-click="handleSave"
  :close-icon="true"
  dialog-width="30%">
  <template #body>
    <div class="body">
      彈窗內容
    </div>
  </template>
  </commonDialog>
</template>

<script lang="ts" setup>
import commonDialog from '../../components/common-Dialog.vue'
import { reactive, computed } from "vue"
const state = reactive({
  confirmText: '确认',
  saveText: '保存',
})
const emit = defineEmits(['closeVisible'])
let dialogVisible = computed(() => props.dialogVisible)
const props = defineProps({
  dialogVisible: Boolean,
  isCheck: { type: Boolean, default: false },
  isEdit: { type: Boolean, default: false },
  isAdd: { type: Boolean, default: false },
  // formData: { type: Object, default: () => { return { id: '', msgId: '', msgTypeId: '' } } }, // 给父组件传递参数的
})
//  叉号事件
const handleCancel = () => {
    emit('closeVisible')
}
// 确认事件
const handleConfirm = () => {
  console.log('确认')
}
// 保存
const handleSave = () => {
  console.log('保存')
}
</script>

<style>
.body {
  padding: 0 30px;
}
</style>